new Vue({
	el: '#app',
	data: {
		uid: '',
		user: '',
		path: '',
		rList: [],
		count: ''
	},
	mounted: function() {
		this.init();
	},
	methods: {
		init: function() {
			this.uid = $api.getStorage('uid');
			if(this.uid) {
				this.getUserMsg();
			} else {
				api.toast({
					msg: "no uid",
					duration: 2000,
					location: 'middle'
				});
			}
		},
		getUserMsg: function() {
			var self = this;
			apiready = function() {
				self.myR();
			};
		},
		//关闭本页面
		close: function() {
			api.closeWin();
		},
		//我的推荐
		myR: function() {
			var self = this;
			console.log(self.uid);
			var data = {
				user_id: self.uid
			};
			$.post(base + config.user_recommend, data, function(msg) {
				console.log(msg);
				if(msg.error == 0) {
					self.rList = msg.data;
					self.count = msg.count;
				} else {
					console.log(msg.error_msg);
					api.toast({
						msg: msg.error_msg,
						duration: 2000,
						location: 'middle'
					});
				}
			}, 'json');
		}
	}
})